﻿// ***********************************************************************
// Assembly         : STX.Domain
// Author           : seven.x
// Created          : 12-26-2013
//
// Last Modified By : seven.x
// Last Modified On : 02-09-2014
// ***********************************************************************
// <copyright file="BizMaterialCategory.cs" company="驰创数码">
//     Copyright (c) 驰创数码. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace STX.Domain
{
    /// <summary>
    /// 物料分类
    /// </summary>
    public class BizMaterialCategory:BaseEntity
    {
        /// <summary>
        /// Enum TypeEnum
        /// </summary>
        public enum TypeEnum
        {
            /// <summary>
            /// The lease
            /// </summary>
            [Field(Name = "活动")]
            Activity = 1,

            /// <summary>
            /// The buy
            /// </summary>
            [Field(Name = "非活动")]
            NoActivity = 2,
        }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }


        /// <summary>
        /// Gets or sets the code.
        /// </summary>
        /// <value>The code.</value>
        public int Code { get; set; }

        [NotMapped]
        public string DisplayName
        {
            get
            {
                return string.Format("{0}/{1}", Name, Code);
            }
        }

        /// <summary>
        /// Gets or sets the type value.
        /// </summary>
        /// <value>The type value.</value>
        public TypeEnum Type { get; set; }
    }
}
